home *** CD-ROM | disk | FTP | other *** search
- head 1.9;
- branch ;
- access ;
- symbols sprited:1.8.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.9
- date 92.03.27.13.41.59; author rab; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 90.09.22.20.32.46; author rab; state Exp;
- branches 1.8.1.1;
- next 1.7;
-
- 1.7
- date 89.03.22.00.47.04; author rab; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 88.11.28.09.26.09; author rab; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 88.07.25.11.10.58; author ouster; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.07.25.10.59.59; author ouster; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.07.14.09.46.48; author ouster; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.06.17.18.10.47; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.05.21.14.46.06; author ouster; state Exp;
- branches ;
- next ;
-
- 1.8.1.1
- date 91.10.01.19.49.43; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.9
- log
- @Added on_exit, and had to change atexit.c and exit.c to make local variables global.
- @
- text
- @/*
- * exit.c --
- *
- * This file contains the source code for the "exit" library
- * procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/exit.c,v 1.8 90/09/22 20:32:46 rab Exp Locker: rab $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <sprite.h>
- #include <proc.h>
-
- /*
- * Variables shared with atexit.c, and on_exit.c:
- */
-
- void (*_exitHandlers[32])(); /* Function table. */
- int _exitNumHandlers = 0; /* Number of functions currently
- * registered in table. */
- long _exitHandlerArgs[32]; /* Arguments to pass to functions. */
- int _exitTableSize = 32; /* Number of entries in table. */
-
- /*
- *----------------------------------------------------------------------
- *
- * exit --
- *
- * Terminate the process.
- *
- * Results:
- * Never returns.
- *
- * Side effects:
- * Any procedures registered by calls to "atexit" are invoked,
- * and any open I/O streams are flushed and closed.
- *
- *----------------------------------------------------------------------
- */
-
- int
- exit(status)
- int status; /* Status to return to parent process. 0 is
- * the normal value for "success". */
- {
- while (_exitNumHandlers > 0) {
- _exitNumHandlers -= 1;
- (*_exitHandlers[_exitNumHandlers])(_exitHandlerArgs[_exitNumHandlers]);
- }
- _cleanup();
- _exit(status);
- }
- @
-
-
- 1.8
- log
- @Changed exit() to call _exit() instead of Proc_RawExit(). Some programs
- define their own _exit instead of using atexit(). E.g. the decStation
- profiler.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/exit.c,v 1.7 89/03/22 00:47:04 rab Exp Locker: rab $ SPRITE (Berkeley)";
- d27 1
- a27 1
- * Variables shared from atexit.c:
- d30 2
- a31 2
- extern void (*_exitHandlers[])(); /* Function table. */
- extern int _exitNumHandlers; /* Number of functions currently
- d33 2
- a34 1
- extern int _exitTableSize; /* Number of entries in table. */
- d60 1
- a60 1
- (*_exitHandlers[_exitNumHandlers])();
- @
-
-
- 1.8.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/exit.c,v 1.8 90/09/22 20:32:46 rab Exp $ SPRITE (Berkeley)";
- @
-
-
- 1.7
- log
- @*** empty log message ***
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/exit.c,v 1.6 88/11/28 09:26:09 rab Exp Locker: rab $ SPRITE (Berkeley)";
- d62 1
- a62 1
- Proc_RawExit(status);
- @
-
-
- 1.6
- log
- @Changed return value to void.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/exit.c,v 1.5 88/07/25 11:10:58 ouster Exp Locker: rab $ SPRITE (Berkeley)";
- d22 1
- d52 1
- a52 1
- void
- @
-
-
- 1.5
- log
- @Lint.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: exit.c,v 1.4 88/07/25 10:59:59 ouster Exp $ SPRITE (Berkeley)";
- d51 1
- @
-
-
- 1.4
- log
- @Make exit have standard UNIX return value.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: exit.c,v 1.3 88/07/14 09:46:48 ouster Exp $ SPRITE (Berkeley)";
- d21 1
- @
-
-
- 1.3
- log
- @Move variables from exit.c to atexit.c, so that atexit can be
- used along with a private exit (as in csh).
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: exit.c,v 1.2 88/06/17 18:10:47 ouster Exp $ SPRITE (Berkeley)";
- a49 1
- void
- @
-
-
- 1.2
- log
- @Call Proc_RawExit, not Proc_Exit.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: exit.c,v 1.1 88/05/21 14:46:06 ouster Exp $ SPRITE (Berkeley)";
- d25 1
- a25 1
- * Variables (shared with atexit.c):
- d28 2
- a29 2
- void (*_exitHandlers[32])(); /* Function table. */
- int _exitNumHandlers = 0; /* Number of functions currently
- d31 1
- a31 1
- int _exitTableSize = 32; /* Number of entries in table. */
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
- d60 1
- a60 1
- Proc_Exit(status);
- @
-